<?php

error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);

$im = new imagick('alphaink.pdf[0]');
$im->setImageFormat('jpg');
$im->thumbnailImage(1500, 0);
header('Content-Type: image/jpeg');
echo $im;
?>